<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<title>智慧验车</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<%=request.getContextPath()%>/bootstrap/css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<script src="<%=request.getContextPath()%>/jquery/jquery-1.10.2.min.js"></script>
<script	src="<%=request.getContextPath()%>/bootstrap/js/bootstrap.min.js"></script>

<style type="text/css">
body {
	background-color: #2a3440;
	color:white;
	font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.mycenter {
	margin-top: 100px;
	margin-left: auto;
	margin-right: auto;
	height: 350px;
	width: 500px;
	padding: 5%;
	padding-left: 5%;
	padding-right: 5%;
}

.mycenter mysign {
	width: 440px;
}


.mycheckbox {
	margin-top: 10px;
	margin-left: 40px;
	margin-bottom: 10px;
	height: 10px;
}

</style>


</head>

<body>
	<section>
		<div class="col-lg-12">
			<form method="post" id="login" name="login" >
				<div class="mycenter">
					<div class="mysign">
						<div class="col-lg-10 text-center">
							<h2><img src="<%=request.getContextPath()%>/images/eee.png" width="60" height="60" class="img-circle">&nbsp;&nbsp;智慧验车</h2>
						</div>
						<div class="col-lg-10">
								<input type="text" class="form-control com.zhihuiyanche.dao.user"
								id="username" name="username" placeholder="请输入账户名" required
								autofocus  aria-describedby="basic-addon1"/>
						</div>
						<div class="col-lg-10"></div>
						<div class="col-lg-10">
							<input type="password" class="form-control lock" name="password"
								id="password" placeholder="请输入密码" required autofocus />
						</div>
						<div class="col-lg-10">
							<p></p>
						</div>
						<div class="col-lg-10">
							<input type="checkbox" class="col-lg-1" />记住密码
						</div>
						<div class="col-lg-10"></div>
						<div class="col-lg-10">
							<button type="button" class="btn btn-success col-lg-12" id="btn-login">登录</button>
						</div>
						<div class="col-lg-10">
							<p></p>
						</div>
						<div class="col-lg-10">
							<p>智慧验车，随时随地查询验车信息，为广大车友提供方便快捷的验车服务</p>
							<a href="signUp" class="text-info pull-right">立即注册</a>
						</div>
					</div>
				</div>
			</form>
		</div>
		
		<nav class="navbar navbar-fixed-bottom text-center">
		   	<p>Copyright &copy; 2017 Company name All rights reserved.</p>
		</nav>
			
	</section>
</body>

<script>
	$("#btn-login").click(function() {

		var _this = $(this);
    	_this.prop("disabled","disabled");
    	
		$.ajax({
			type : "POST",
			url : "getUser",
			data : $('#login').serialize(),// 你的formid
			success : function(data) {
				if (data == 1) {
					
					window.location.href = "toOrderListPage";
					
				} else if(data == 0){
					
					alert("用户名或密码错误");
					_this.prop("disabled",false);
					
				}else if(data == 2){
					
					alert("该用户店铺未激活");
					_this.prop("disabled",false);
					
				}

			},
			error : function() {
				alert("查询失败");
			}
		});
	});
</script>
</html>